package io;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * 字符缓冲输出流测试
 */
public class BufferedWriterTest {
    public static void main(String[] args) {
        writeChars();
    }

    private static void writeChars() {
        try (
                BufferedWriter bw = new BufferedWriter(new FileWriter("/Users/luchuan/IdeaProjects/java-test/a.txt"))
        ) {
            for (int i = 0; i < 10; i++) {
                bw.write("你好");
                bw.newLine();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
